import { MyAppType } from "@/router/type";
import { lazy } from "react";
import WithLoading from "@/layout/WithLoading";
import { HomeOutlined } from "@ant-design/icons";

const HomeOne = lazy(() => import("@/views/Home/HomeOne"));
const HomeTwo = lazy(() => import("@/views/Home/HomeTwo"));
const ContextStudy = lazy(() => import("@/views/Home/ContextStudy"));
const Another = lazy(() => import("@/views/Home/Another"));
const StateAndRef = lazy(() => import("@/views/Home/StateAndRef"));
const CanvasStudy = lazy(() => import("@/views/Home/CanvasStudy"));
const MyTsReview = lazy(()=>import('@/views/Home/MyTsReview'));

const home: MyAppType = {
  path: "/home",
  name: "home",
  meta: {
    icon: <HomeOutlined />,
    title: "知识回顾",
    order: 1,
  },
  children: [
    {
      path: "one",
      name: "HomeOne",
      element: WithLoading(<HomeOne />),
      meta: {
        title: "class类",
      },
    },
    {
      path: "two",
      name: "HomeTwo",
      meta: {
        title: "父子传参",
      },
      element: WithLoading(<HomeTwo />),
    },
    {
      path: "contextStudy",
      name: "ContextStudy",
      meta: {
        title: "上下文回顾",
      },
      element: WithLoading(<ContextStudy />),
    },
    {
      path: "another",
      name: "Another",
      meta: {
        title: "其余补充",
      },
      element: WithLoading(<Another />),
    },
    {
      path: "stateAndRef",
      name: "StateAndRef",
      meta: {
        title: "state和ref",
      },
      element: WithLoading(<StateAndRef />),
    },
    {
      path: "canvasStudy",
      name: "CanvasStudy",
      meta: {
        title: "canvas回顾",
      },
      element: WithLoading(<CanvasStudy />),
    },
    {
      path: "myTsReview",
      name: "MyTsReview",
      meta: {
        title: "ts进阶与回顾",
      },
      element: WithLoading(<MyTsReview />),
    },
  ],
};

export default home;
 